Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information linear and non-linear solver outputs #1076

Merged
merged 18 commits into from
Apr 6, 2024

Conversation

hepap
Copy link
Collaborator

@hepap hepap commented Mar 21, 2024

Description of the problem

  • The console output of the non-linear solver in the NS solver was showing the the norms of the newton update without distinction between the velocity and pressure contributions.
  • The final residual norm of the linear solver was not outputted, only the tolerance.

Description of the solution

  • Add the distinction between the velocity and pressure contributions in the non-linear solver output.
  • Add the final value of the linear residual when verbosity is at verbose. If it is at extra verbose, the solver output the residual for each iteration (already implemented but not documented).

How Has This Been Tested?

A unit test was added.

  • vector_problem.cc

Documentation

Add a comment for the extra verbose verbosity of the linear solver.

  • linear_solver_control.rst

@hepap hepap force-pushed the add_information_linear_solver_output branch from 60aabc4 to 9e9b060 Compare March 21, 2024 14:43
@hepap hepap requested a review from AmishgaAlphonius March 21, 2024 14:44
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very few comments, amazing work @hepap

include/solvers/tracer.h Show resolved Hide resolved
source/solvers/navier_stokes_base.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_base.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_base.cc Show resolved Hide resolved
tests/core/vector_problem.cc Outdated Show resolved Hide resolved
tests/core/vector_problem.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_base.cc Outdated Show resolved Hide resolved
tests/core/non_linear_test_system_01.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@PierreLaurentinCS PierreLaurentinCS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing feature, and very few comments. Good job !

doc/source/parameters/cfd/linear_solver_control.rst Outdated Show resolved Hide resolved
include/solvers/cahn_hilliard.h Outdated Show resolved Hide resolved
source/solvers/navier_stokes_base.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_base.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work ! Thanks ! :)
I only have a few minor comments to add.

include/core/physics_solver.h Outdated Show resolved Hide resolved
include/solvers/cahn_hilliard.h Outdated Show resolved Hide resolved
include/solvers/heat_transfer.h Outdated Show resolved Hide resolved
include/solvers/navier_stokes_base.h Outdated Show resolved Hide resolved
include/solvers/tracer.h Outdated Show resolved Hide resolved
include/solvers/vof.h Outdated Show resolved Hide resolved
Comment on lines 2511 to 2520
for (auto j = index_set_velocity[d].begin();
j != index_set_velocity[d].end();
j++)
{
double dof_newton_update = newton_update[*j];

local_sum += dof_newton_update * dof_newton_update;

if (dof_newton_update > local_max)
{
local_max = dof_newton_update;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These loops on index_sets could be inlined if you wish :)

source/solvers/navier_stokes_base.cc Show resolved Hide resolved
@hepap
Copy link
Collaborator Author

hepap commented Apr 5, 2024

I think it is ready to merge if the tests pass! The output was added for CH as well :)

@blaisb
Copy link
Contributor

blaisb commented Apr 5, 2024

@hepap some tests are breaking, can you double check them?

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once CI is fixed, this is ready for a merge IMO

@hepap
Copy link
Collaborator Author

hepap commented Apr 5, 2024

Should be alright now!

@blaisb blaisb merged commit 4632e53 into master Apr 6, 2024
8 checks passed
@blaisb blaisb deleted the add_information_linear_solver_output branch April 6, 2024 07:17
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
)

Description of the problem
The console output of the non-linear solver in the NS solver was showing the the norms of the newton update without distinction between the velocity and pressure contributions.
The final residual norm of the linear solver was not outputted, only the tolerance.
Description of the solution
Add the distinction between the velocity and pressure contributions in the non-linear solver output.
Add the final value of the linear residual when verbosity is at verbose. If it is at extra verbose, the solver output the residual for each iteration (already implemented but not documented).
How Has This Been Tested?
A unit test was added.
 vector_problem.cc

Co-authored-by: Pierre Laurentin <[email protected]>
Co-authored-by: Amishga Alphonius <[email protected]>
Former-commit-id: 4632e53
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description of the problem
The console output of the non-linear solver in the NS solver was showing the the norms of the newton update without distinction between the velocity and pressure contributions.
The final residual norm of the linear solver was not outputted, only the tolerance.
Description of the solution
Add the distinction between the velocity and pressure contributions in the non-linear solver output.
Add the final value of the linear residual when verbosity is at verbose. If it is at extra verbose, the solver output the residual for each iteration (already implemented but not documented).
How Has This Been Tested?
A unit test was added.
 vector_problem.cc

Co-authored-by: Pierre Laurentin <[email protected]>
Co-authored-by: Amishga Alphonius <[email protected]>
Former-commit-id: 4632e53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants